// api.js
import request from '../request';
// 登录
export const login = (params) => {
  return request({
    url: '/vilion/user/login',
    method: 'POST',
    data: params
  });
};
// 获取登录邮箱验证码
export const getLoginEmailCode = (params) => {
  return request({
    url: '/vilion/user/getCode',
    method: 'GET',
    data: params
  });
};

// 注册账号

// 校验证号是否已存在
export const checkUsernameExists = (params) => {
  return request({
    url: '/vilion/user/register/verifyUsername',
    method: 'GET',
    data: params
  });
};

// 获取邮箱验证码
export const checkUserEmailExists = (params) => {
  return request({
    url: '/vilion/user/register/getEmailCode',
    method: 'GET',
    data: params
  });
};

// 注册
export const userRegistration = (params) => {
  return request({
    url: '/vilion/user/register',
    method: 'POST',
    data: params
  });
};




// 修改密码
// 获取邮箱验证码
export const getPasswordEmailCode = (params) => {
  return request({
    url: '/vilion/user/forgetPassword/getUserEmailCode',
    method: 'GET',
    data: params
  });
};

// 校验邮箱验证码
export const verifyTheEmailVerificationCode = (params) => {
  return request({
    url: '/vilion/user/forgetPassword/VerifyUserEmailCode',
    method: 'GET',
    data: params
  });
};

// 重置密码
export const resetYourPassword = (params) => {
  return request({
    url: '/vilion/user/forgetPassword/changePassword',
    method: 'POST',
    data: params
  });
};


// 用户协议与隐私协议

export const getAgreement = (params) => {
  return request({
    url: '/vilion/user/getAgreement',
    method: 'GET',
    data: params
  });
};

